<template>
	<view>
		<Header title="我的优惠卷" fontSize="36rpx" color="#202020" :fanhui="true" />
		<view class="popbox">
			<view class="popxuan">
				<text>选择优惠券</text>
			</view>
			<scroll-view class="" scroll-y="true" style="height: 100vh;">
				<view class="popjuan" v-for="(item,i) in couponPort">
					<view class="popjuan_flx">
						<view style="margin-left: 40rpx; ">
							<view class="popjuan_flx_one">
								<view class="popjuan_btn">返点卷</view>
								<view class="popjuan_tetx">+{{item.reduction}}%的{{item.couponAlias}}</view>
							</view>
							<view class="popjuan_flx_one_time" v-if="item.beginTime & item.endTime">
								{{item.beginTime}}-{{item.endTime}} <span class="popjuan_flx_one_text"> 即将到期</span>
							</view>
						</view>
						<view class="" style="margin-right: 40rpx;">
							<view><span class="popjuan_two">{{item.reduction}}</span><span
									class="popjuan_two_blue">%</span></view>
							<view class="popjuan_men" v-if="!item.meetWith">无门槛</view>
							<view class="popjuan_men" v-else>{{item.meetWith}}</view>
						</view>
					</view>
					<view class="line_box">
						<view class="circle"></view>
						<view class="line_xian"></view>
						<view class="circle1"></view>
					</view>
					<view class="popjuan_xia">
						<view class="" style="display: flex;align-items: center;">
							<view class="popjuan_xia_text">详细信息</view>
							<image src="@/static/order/xiala.png" mode="aspectFill" style="width: 34rpx;height: 20rpx;">
							</image>
						</view>
						<!-- <view class="popjuan_change1" @click="PortItem()" v-if="couponPortId==item.rid">取消使用</view> -->
						<!-- <view class="popjuan_change" @click="couponPortItem(item)" v-else>使用</view> -->
						<!-- <view class="popjuan_change1" v-else>不可用</view> -->
					</view>
				</view>
				<view class="" style="height: 150rpx;"></view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import Header from '@/components/header/header.vue'
	export default {
		components: {
			Header
		},
		data() {
			return {
				couponPort: []
			}
		},
		onLoad() {
			this.cread()
		},
		methods: {
			async cread() {
				let res = await this.$http.users.queryUserCoupon({
					couponPort: 'driver',
				})
				this.couponPort = res.data.data
			},
		}
	}
</script>

<style>
	.popjuan_xia {
		display: flex;
		justify-content: space-between;
		padding: 0 30rpx;
	}

	.popjuan_xia_text {
		font-size: 24rpx;
		color: #999999;
		margin-right: 15rpx;
	}

	.popjuan_change {
		width: 140rpx;
		height: 60rpx;
		text-align: center;
		line-height: 60rpx;
		background-color: #00A0E9;
		color: #fff;
		border-radius: 30rpx;
	}

	.popjuan_change1 {
		width: 140rpx;
		height: 60rpx;
		text-align: center;
		line-height: 60rpx;
		background-color: #999999;
		color: #fff;
		border-radius: 30rpx;
	}

	.line_xian {
		width: 630rpx;
		border-bottom: 1rpx solid #F0F0F0;
	}

	.line_box {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.circle {
		width: 20rpx;
		height: 45rpx;
		border-radius: 0 20rpx 20rpx 0;
		line-height: 45rpx;
		background-color: #F6F6F6;
	}

	.circle1 {
		width: 20rpx;
		height: 45rpx;
		border-radius: 20rpx 0rpx 0rpx 20rpx;
		line-height: 45rpx;
		background-color: #F6F6F6;
	}

	.popjuan_two {
		font-size: 70rpx;
	}

	.popjuan_men {
		font-size: 24rpx;
		color: #999999;
	}

	.popjuan_two_blue {
		font-size: 22rpx;
	}

	.popjuan_flx_one_text {
		font-size: 22rpx;
		color: #00A0E9;
	}

	.popjuan_flx_one_time {
		font-size: 22rpx;
		color: #666666;
		margin-top: 40rpx;
	}

	.popjuan_flx_one {
		display: flex;
	}

	.popjuan_flx {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-top: 20rpx;
	}

	.popjuan_tetx {
		font-size: 30rpx;
		font-weight: 600;
	}

	.popbox {
		height: 60vh;
		background-color: #F6F6F6;
	}

	.popjuan {
		width: 710rpx;
		height: 260rpx;
		background-color: #fff;
		margin-top: 15rpx;
		margin-left: 20rpx;
		border-radius: 10rpx;
		padding-bottom: 20rpx;
	}

	.popjuan_btn {
		width: 90rpx;
		height: 40rpx;
		text-align: center;
		line-height: 40rpx;
		background-color: #00A0E9;
		color: #fff;
		border-radius: 15rpx;
		font-size: 24rpx;
		margin-right: 20rpx;
	}

	.popxuan {
		height: 126rpx;
		width: 100%;
		text-align: center;
		line-height: 126rpx;
		background-color: #fff;
	}
</style>